let tasks = {
  [Symbol.iterator] () {
    let steps = this.actions.slice()
    return {
      [Symbol.iterator] () {
        return this
      },
      next(...args) {
        if (steps.length > 0) {
          let res = steps.shift()(...args)
          return {
            value: res,
            done: false
          }
        } else {
          return {
            done: true
          }
        }
      },
      return (v) {
        steps.length = 0
        return {
          value: v,
          done: true
        }
      }
    }
  },
  actions: []
}

export default tasks
